import { createRouter, createWebHistory } from 'vue-router';
import { Layout } from '/@/components/layout';

const importPage = (view: string) => () => import(`../views/${view}.vue`);

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: Layout,
      children: [{ path: 'home', component: importPage('system/home') }],
    },
    { path: '/login', component: importPage('system/login') },
  ],
});
export default router;
